import request from '@/utils/request';

export async function getGuideBookFileInfoByPage (params: any) {
    return request('/api/product/getGuideBookFileInfoByPage', {
    method: 'POST',
    data: params,
  });
}

export async function addGuideBookFileInfo (params: any) {
    return request('/api/product/addGuideBookFileInfo', {
    method: 'POST',
    data: params,
  });
}

export async function updateGuideBookFileInfo (params: any) {
    return request('/api/product/updateGuideBookFileInfo', {
    method: 'POST',
    data: params,
  });
}

export async function delGuideBookFileInfo (params: any) {
    return request('/api/product/delGuideBookFileInfo', {
    method: 'POST',
    data: params,
  });
}

export async function exportGuideBookFileInfo(params: any) {
    return request('/api/product/exportGuideBookFileInfo', {
    method: 'POST',
    data: params,
    responseType: 'blob',
  });
}

// 获取当前用户名
export async function viewBaseInfo(params: any) {
  return request('/api/user/viewBaseInfo', {
    method: 'POST',
    data: params,
  });
}

// 获取url
export async function getGuideBookFileInfoPreviewUrl2(params: any) {
  return request('/api/product/getGuideBookFileInfoPreviewUrl2', {
    method: 'POST',
    data: params,
  });
}

// 下载
export async function downloadGuideBookFile2(para: any) {
  return request('/api/product/downloadGuideBookFile2', {
    method: 'POST',
    responseType: 'blob',
    data: para,
  });
}

// 查询文件信息
export async function getGuideBookFileInfoBybatchProductId(para: any) {
  return request('/api/product/getGuideBookFileInfoBybatchProductId', {
    method: 'POST',
    params:{
      batchProductId:para
    },
  });
}
export default { getGuideBookFileInfoByPage, addGuideBookFileInfo, updateGuideBookFileInfo, delGuideBookFileInfo, exportGuideBookFileInfo }
